package com.zidian.teacher.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.zidian.teacher.fragment.ColleagueEvaFragment;
import com.zidian.teacher.fragment.CustomEvaFragment;
import com.zidian.teacher.fragment.StudentEvaFragment;

/**
 * Created by GongCheng on 2017/1/9.
 */

public class EvaluatePagerAdapter extends FragmentPagerAdapter {
    public EvaluatePagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0:
                return StudentEvaFragment.newInstance();
            case 1:
                return ColleagueEvaFragment.newInstance("supervisorEvaluation");
            case 2:
                return ColleagueEvaFragment.newInstance("colleagueEvaluation");
            case 3:
                return CustomEvaFragment.newInstance();
            default:
                return StudentEvaFragment.newInstance();
        }
    }

    @Override
    public int getCount() {
        return 4;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0:
                return "学生评价";
            case 1:
                return "督导评价";
            case 2:
                return "同行评价";
            case 3:
                return "自定义评价";
            default:
                return "学生评价";
        }
    }
}
